package com.xxx.dao;

import com.xxx.model.Article;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface ArticleMapper {
    int insert(Article row);

    int insertSelective(Article row);

    Article selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(Article row);

    int updateByPrimaryKeyWithBLOBs(Article row);

    int updateByPrimaryKey(Article row);

    List<Article> selectAll();


    List<Article> selectAllByBoardId(@Param("boardId") Long boardId);//@Param()和数据库中的#{}中的参数对应

    Article selectDetailById(@Param("id") Long id);

    List<Article> selectByUserId(@Param("userId") Long userId);

//    List<Article> selectAllByPage(Integer offset, Integer pageSize);
//
//    List<Article> selectAllByBoardIdAndPage(Long boardId, Integer offset, Integer pageSize);

}